﻿using System;
using System.Linq;
using System.ComponentModel;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.IO.IsolatedStorage;
using System.Runtime.Serialization;

namespace SBPweb.RIA.Client.Contracts.Base
{

    [CollectionDataContract]
    public class ApplicationLocalCache : LocalStoreBase<ApplicationLocalCache, ApplicationLocalCacheFormatter>
    {

        #region Constructor logic

        static ApplicationLocalCache()
        {
            FileName = "ApplicationCache.xml";
            Scope = StorageScopes.Application;
        }

        public ApplicationLocalCache()
            : base()
        {
        }

        public ApplicationLocalCache(IEnumerable<KeyValuePair<string, object>> keyValues)
            : base(keyValues)
        {
        }

        #endregion
        
    }

    public class ApplicationLocalCacheFormatter : LocalStoreFormatterBase
    {

        public override IsolatedStorageFileStream DecodeIsoStream(IsolatedStorageFileStream isoStream)
        {
            return isoStream;
        }

        public override IsolatedStorageFileStream EncodeIsoStream(IsolatedStorageFileStream isoStream)
        {
            return isoStream;
        }

    }

}